package com.ledi.guns.common.persistence.dao;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.ledi.guns.common.persistence.model.SchoolInfo;
import com.ledi.guns.common.persistence.model.vo.AccountVo;
import com.ledi.guns.common.persistence.model.vo.CurrentSchoolDataVo;
import com.ledi.guns.common.persistence.model.vo.ExportSchoolInfoVo;
import com.ledi.guns.common.persistence.model.vo.HotSchoolVo;
import com.ledi.guns.common.persistence.model.vo.SchoolInfoVo;
import com.ledi.guns.common.persistence.model.vo.UserVo;
import com.ledi.guns.modular.ledipay.controller.req.school.QuerySchoolInfo;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author ledi
 * @since 2017-11-30
 */
public interface SchoolInfoMapper extends BaseMapper<SchoolInfo> {

	List<SchoolInfoVo> getSchoolInfo(Page<SchoolInfoVo> page, Map<String, Object> map);

	int getSchoolInfoCount(Map<String, Object> search);

	List<AccountVo> getAccount(Long schoolId);

	/**
	 * 获取热门学校数据
	 *
	 * @param startTime
	 * @param endTime
	 * @return List<HotSchoolVo>
	 */
	List<HotSchoolVo> getHotSchoolData(@Param("startTime") Date startTime, @Param("endTime") Date endTime,
			@Param("agentId") Long agentId);

	/**
	 * 获取新增的学校数目
	 *
	 * @param map
	 * @return
	 */
	int getTotalSchoolNum(Map<String, Object> map);

	/**
	 * 获取当前学校统计
	 *
	 * @param startTime
	 * @param endTime
	 * @return
	 */
	List<CurrentSchoolDataVo> getCurrentSchoolNum(@Param("startTime") Date startTime, @Param("endTime") Date endTime,
			@Param("agentId") Long agentId);

	/**
	 * 获取导出学校信息列表
	 *
	 * @param querySchoolInfo
	 * @return
	 */
	List<ExportSchoolInfoVo> getExportSchoolInfo(@Param("querySchoolInfo") QuerySchoolInfo querySchoolInfo);

	UserVo querySchoolInfo(@Param("schoolId") Long schoolId);
}
